import { FC, lazy, Suspense } from "react";

type TModule = Parameters<typeof lazy>[0];
interface LazyProps {
	module: TModule;
}

const Lazy: FC<LazyProps> = props => {
	const { module } = props;
	const LazyComp = lazy(module);
	return (
		<Suspense>
			<LazyComp />
		</Suspense>
	);
};

export default Lazy;
